home *** CD-ROM | disk | FTP | other *** search
/ Mastering Microsoft Visual Basic 5 / Mastering Microsoft Visual Basic 5.ISO / sampapps / objectsharing / sharingclient.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-01-27  |  3.7 KB  |  126 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Object Sharing Client"
  4.    ClientHeight    =   1815
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   6255
  8.    LinkTopic       =   "Form1"
  9.    LockControls    =   -1  'True
  10.    ScaleHeight     =   1815
  11.    ScaleWidth      =   6255
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.CommandButton cmdClose 
  14.       Caption         =   "&Close"
  15.       Height          =   375
  16.       Left            =   4680
  17.       TabIndex        =   8
  18.       Top             =   1200
  19.       Width           =   1455
  20.    End
  21.    Begin VB.CommandButton cmdDisplay 
  22.       Caption         =   "&Display Text"
  23.       Height          =   375
  24.       Left            =   4680
  25.       TabIndex        =   7
  26.       Top             =   720
  27.       Width           =   1455
  28.    End
  29.    Begin VB.CommandButton cmdSetText 
  30.       Caption         =   "&Set New Text"
  31.       Height          =   375
  32.       Left            =   4680
  33.       TabIndex        =   6
  34.       Top             =   240
  35.       Width           =   1455
  36.    End
  37.    Begin VB.TextBox txtLCase 
  38.       Height          =   375
  39.       Left            =   1680
  40.       TabIndex        =   5
  41.       Top             =   1200
  42.       Width           =   2415
  43.    End
  44.    Begin VB.TextBox txtUCase 
  45.       Height          =   375
  46.       Left            =   1680
  47.       TabIndex        =   3
  48.       Top             =   720
  49.       Width           =   2415
  50.    End
  51.    Begin VB.TextBox txtText 
  52.       Height          =   375
  53.       Left            =   1680
  54.       TabIndex        =   1
  55.       Top             =   240
  56.       Width           =   2415
  57.    End
  58.    Begin VB.Label Label2 
  59.       Caption         =   "Lower Case:"
  60.       Height          =   255
  61.       Index           =   2
  62.       Left            =   180
  63.       TabIndex        =   4
  64.       Top             =   1260
  65.       Width           =   1335
  66.    End
  67.    Begin VB.Label Label2 
  68.       Caption         =   "Upper Case:"
  69.       Height          =   255
  70.       Index           =   1
  71.       Left            =   180
  72.       TabIndex        =   2
  73.       Top             =   780
  74.       Width           =   1335
  75.    End
  76.    Begin VB.Label Label2 
  77.       Caption         =   "&Text:"
  78.       Height          =   255
  79.       Index           =   0
  80.       Left            =   180
  81.       TabIndex        =   0
  82.       Top             =   300
  83.       Width           =   1335
  84.    End
  85. Attribute VB_Name = "Form1"
  86. Attribute VB_GlobalNameSpace = False
  87. Attribute VB_Creatable = False
  88. Attribute VB_PredeclaredId = True
  89. Attribute VB_Exposed = False
  90. Option Explicit
  91. Dim objsvr As IServer.ObjServer
  92. Dim WithEvents so As IServer.SomeObject
  93. Attribute so.VB_VarHelpID = -1
  94. Dim sc As IServer.IStringCase
  95. Private Sub cmdDisplay_Click()
  96.   ' Have the component display a message box containing the
  97.   ' stored text.
  98.   so.Display
  99. End Sub
  100. Private Sub cmdSetText_Click()
  101.   ' Set the text and get the uppercase through the default inteface.
  102.   so.Text = txtText
  103.   txtUCase = so.IStringCase_UCaseText
  104.   ' Get the lowercase text through the IStringCase interface.
  105.   txtLCase = sc.LCaseText
  106. End Sub
  107. Private Sub cmdClose_Click()
  108.   Unload Me
  109. End Sub
  110. Private Sub Form_Load()
  111.   ' Create the object server
  112.   Set objsvr = New IServer.ObjServer
  113.   ' Get the shared object
  114.   Set so = objsvr.SomeObject
  115.   ' Get pointer to the shared object's IStringCase interface
  116.   Set sc = so
  117. End Sub
  118. Private Sub so_TextChanged(str As String)
  119.   ' Get the normal and uppercase text through the default
  120.   ' interface.
  121.   txtText = so.Text
  122.   txtUCase = so.IStringCase_UCaseText
  123.   ' Get the lowercase text through the IStringCase interface.
  124.   txtLCase = sc.LCaseText
  125. End Sub
  126.